package com.example.administrator.about_huanxin.activity;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.example.administrator.about_huanxin.R;

public abstract class BaseActivity extends AppCompatActivity {

    private TextView base_activity_title_tv;
    private Button base_activity_title_btn;
    private FrameLayout base_activity_container;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_base);
        base_activity_title_tv = (TextView) findViewById(R.id.base_activity_title_tv);
        base_activity_title_btn = (Button) findViewById(R.id.base_activity_title_btn);
        base_activity_container = (FrameLayout) findViewById(R.id.base_activity_container);

        setTitleText(base_activity_title_tv);
        setVisibleBtn(base_activity_title_btn);
        View view = addContent(getLayoutInflater(),base_activity_container);
        initContent(view);
    }

    public abstract void setTitleText(TextView tv);

    public abstract void setVisibleBtn(Button btn);

    public abstract View addContent(LayoutInflater inflater,FrameLayout content);

    public abstract void initContent(View view);
}
